import junit.framework.TestCase;
import junit.framework.TestResult;
import org.junit.Test;

import java.util.Arrays;

/**
 * Created by lenovo on 2017/5/10.
 */
public class teeeeTest extends TestCase {
    int a[] = new int[] {1, 3, 4, 6, 8, 9};
    int x1 = Arrays.binarySearch(a, 5);
    int x2 = Arrays.binarySearch(a, 4);
    int x3 = Arrays.binarySearch(a, 0);
    int x4 = Arrays.binarySearch(a, 10);
    String a1="hello world qw qweqe";
    String b="qweerqeeqweqw";
    String c="2:3:4:5";
    public static String[] ss = new String[20];
    @Test
    public void  testcharAt()
    {
        assertEquals('h',a1.charAt(0));
        assertEquals('e',a1.charAt(1));
    }
    @Test
    public void  testsplit()
    {
        ss=a1.split(" ");
        assertEquals("hello",ss[0]);
        assertEquals("world",ss[1]);
    }
    @Test
    public void  testbinaryseach()
    {
        assertEquals(-4,Arrays.binarySearch(a, 5));
        assertEquals(2,Arrays.binarySearch(a, 4));
    }
    @Test
    public void  testsort()
    {
        int [] arr={1,2,6,4,3};
        Arrays.sort(arr);
        assertEquals(3,arr[2]);
    }
}
